<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>二级分类-me</title>
    <link rel="stylesheet" href="./lib/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="./lib/bootstrap-validator/css/bootstrapValidator.min.css">
    <link rel="stylesheet" href="./lib/nprogress/nprogress.css">
    <!-- 公共的css文件 -->
    <link rel="stylesheet" href="./css/common.css">
    <link rel="stylesheet" href="./css/index.css">
</head>

<body>
    <!-- 乐淘侧边栏部分 -->
    <div class="lt-aside">
        <!-- 标题 -->
        <h3 class="title">
            <a href="#">黑马34期</a>
        </h3>
        <!-- 头像 -->
        <div class="user">
            <img src="./images/default.png" alt="">
            <p>超级管理员</p>
        </div>
        <!-- 导航 -->
        <ul class="nav clearfix">
            <li>
                <a href="user.html">
                    <span class="glyphicon glyphicon-user"></span>
                    用户管理
                </a>
            </li>
            <li>
                <a href="#">
                    <span class="glyphicon glyphicon-th-list"></span>
                    分类管理
                </a>
                <ul class="clearfix child" style="display: block">
                    <li><a href="first.html">一级分类</a></li>
                    <li><a href="second.html">二级分类</a></li>
                </ul>
            </li>
            <li class="current">
                <a href="product.html">
                    <span class="glyphicon glyphicon-tags"></span>
                    商品管理
                </a>
            </li>
        </ul>
    </div>
    <!-- 乐淘主体部分 -->
    <div class="lt-main">
        <!-- 顶部条 -->
        <div class="topbar">
            <a href="#" class="glyphicon glyphicon-align-justify menu pull-left"></a>
            <a href="#" class="glyphicon glyphicon-log-out login-out pull-right"></a>
        </div>
        <!-- 下面部分 -->
        <div class="container-fluid">

            <!-- 路径部分 -->
            <ol class="breadcrumb lt-url">
                <li><a href="#">管理系统</a></li>
                <li class="active">商品管理</li>
            </ol>
            <!-- 添加按钮 -->
            <!-- data-toggle="modal" data-target="#first-modal"控制模态框的显示与隐藏 -->
            <button class="btn-add btn btn-default" data-toggle="modal" data-target="#first-modal">添加商品</button>
            <!-- 数据部分 -->
            <table class="table table-bordered table-hover mt-20">
                <thead>
                    <tr>
                        <th>序号</th>
                        <th>商品名称</th>
                        <th>商品描述</th>
                        <th>商品库存</th>
                        <th>商品尺寸</th>
                        <th>商品状态</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td> 1</td>
                        <td> 1</td>
                        <td> 1</td>
                        <td> 1</td>
                        <td> 1</td>
                        <td> 1</td>
                        <td> 1</td>
                    </tr>
                </tbody>
            </table>
            <!-- 分页导航部分 -->
            <div class="pull-right">
                <ul class="pag-product"></ul>
            </div>

        </div>
    </div>

    <!-- 模态框 -->
    <div class="modal fade" tabindex="-1" id="first-modal">
        <div class="modal-dialog modal-md">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">添加商品</h4>
                </div>
                <div class="modal-body">
                    <form id="form">
                        <div class="form-group">
                            <div class="btn-group">
                                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                                    <span class="check-cate"> 请选择二级分类</span>
                                    <span class="caret"></span>
                                </button>

                                <ul class="dropdown-menu cate-menu">
                                    <!-- <li><a href="#">Action</a></li> -->
                                </ul>
                            </div>
                            <input type="hidden" name="categoryId" id="categoryId" value="">
                        </div>
                        <div class="form-group">
                            <input type="text" class="form-control" id="proName" placeholder="请输入商品名称" name="proName">
                        </div>
                        <div class="form-group">
                            <textarea class="form-control" rows="3" id="proDesc" placeholder="请输入商品描述" name="proDesc"></textarea>
                        </div>
                        <div class="form-group">
                            <input type="text" class="form-control" id="num" placeholder="请输入商品库存" name="num">
                        </div>
                        <div class="form-group">
                            <input type="text" class="form-control" id="size" placeholder="请输入商品尺码" name="size">
                        </div>
                        <div class="form-group">
                            <input type="text" class="form-control" id="oldPrice" placeholder="请输入商品原价" name="oldPrice">
                        </div>
                        <div class="form-group">
                            <input type="text" class="form-control" id="price" placeholder="请输入商品现价" name="price">
                        </div>
                        <div class="form-group">
                            <label for="fileupload" class="btn btn-default">上传图片</label>
                            <input id="fileupload" type="file" name="pic1" data-url="/product/addProductPic" multiple style="display: none">
                        </div>
                        <div class="form-group" id="pic-imgs">
                           <!-- <img src="" alt="" id="img1" width="100px"> -->
                           <!-- <img src="" alt="" id="img2" width="100px">
                           <img src="" alt="" id="img3" width="100px"> -->
                           <!-- 产品图片隐藏域 用来标记图片是否上传了3张-->
                           <input type="hidden" name="picArr" id="ProductPic">
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="submit" class="btn btn-primary add-cate" form="form">添加</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->
    <!-- 商品模板 -->
    <script type="text/html" id="tmp-product">
        {{each rows v i}}
            <tr>
                <td>{{i +1 + (page-1) * size}}</td>
                <td>{{v.proName}}</td>
                <td>{{v.proDesc}}</td>
                <td>{{v.num}}</td>
                <td>{{v.size}}</td>
                <td>{{v.statu == 1? '已上架' : '已下架'}}</td>
                <td>
                    {{if v.statu}}
                        <button type="button" class="btn btn-danger">下架</button>
                    {{else}}
                        <button type="button" class="btn btn-primary">上架</button>
                    {{/if}}
                </td>
            </tr>
        {{/each}}
    </script>

    <!-- 模态框二级分类模板 -->
    <script type="text/html" id="tmp-categorty">
        {{each rows v i}}
            <li data-id="{{v.id}}"><a href="#">{{v.brandName}}</a></li>
        {{/each}}
    </script>



    <script src="./lib/jquery/jquery.min.js"></script>
    <script src="./lib/bootstrap/js/bootstrap.min.js"></script>
    <script src='./lib/bootstrap-paginator/bootstrap-paginator.min.js'></script>
    <script src="./lib/bootstrap-validator/js/bootstrapValidator.min.js"></script>
    <!-- 进度条 -->
    <script src="./lib/nprogress/nprogress.js"></script>
    <!-- 模板引擎 -->
    <script src="./lib/artTemplate/template-web.js"></script>
    <!-- 引入ui 小部件 -->
    <script src="./lib/jquery-fileupload/jquery.ui.widget.js"></script>
    <!-- 如果上传图片需要跨域，那么需要引入这个js文件，如果不跨域，则不需要引入 -->
    <script src="./lib/jquery-fileupload/jquery.iframe-transport.js"></script>
    <!-- 引入图片上传插件 -->
    <script src="./lib/jquery-fileupload/jquery.fileupload.js"></script>
    <!-- 判断用户有没有登录过的js文件 -->
    <script src="./js/islogin.js"></script>
    <!-- 公共的js文件 -->
    <script src="./js/common.js"></script>
    <script src="./js/product.js"></script>

</body>

</html>